<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="./vue2.js"></script>
</head>

<body>
    <div id="app">
        <index-A></index-A>
        <index-B></index-B>
        <index-C></index-C>
        <index-d></index-d>
    </div>

    <template id="itcast">
        <P>itcast</P>
    </template>

    <script type="x-template" id="heima">
        <p>indexD</p>
    </script>
    <script>
        /* 1、 Vue.extend()+ Vue.component()*/
        var Index = Vue.extend({
            /*   var Index = Vue.extend({ */
            template: "<div>我是首页1 </div>"
        });

        Vue.component("indexA", Index);

        /* 2、Vue.component */
        Vue.component("indexB", {
            template: " <div> 我是首页2 </div>"
        });

        /* 3、使用template标签定义模板 */
        Vue.component("indexC", {
            template: "#itcast"
        });

        Vue.component("indexD", {
            template: "#heima"
        });




        var vm = new Vue({
            el: '#app',
            data: {

            }
        })
    </script>
</body>

</html>